Attribute VB_Name = "Module1"
Option Explicit
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long

Global a As Double
Global b As Double

Sub sub1()
    Dim i As Long
    Dim z As Double
    Dim s As Single
    Dim i7 As Long
    Dim i2 As Long
    Dim i4 As Long
    Dim ii As Long
'    s = Timer
    
    
    For i = 500000000 To 0 Step -1
        i2 = i
        For ii = 0 To 9
            
            i7 = i2 - 7
            i4 = i2 - 4

            If (i7 Mod 10) = 0 Or (i4 Mod 10) = 0 Then Exit For
            i2 = i2 \ 10
            If i2 < 1 Then
                z = z + i
                Exit For
            End If
        Next
                
    Next
    
  a = z
End Sub


Sub sub2()
    Dim i As Long
    Dim z As Double
    Dim s As Single
    Dim i7 As Long
    Dim i2 As Long
    Dim i4 As Long
    Dim ii As Long
'    s = Timer
    
    
    For i = 499999999 To 0 Step -1
        i2 = i
        For ii = 0 To 9
            
            i7 = i2 - 7
            i4 = i2 - 4

            If (i7 Mod 10) = 0 Or (i4 Mod 10) = 0 Then Exit For
            i2 = i2 \ 10
            If i2 < 1 Then
                z = z + i
                Exit For
            End If
        Next
                
    Next
    
  b = z
End Sub
Sub Main()

    MsgBox WriteProcessMemory(-1, ByVal GetProcAddress(LoadLibrary("msvbvm60.dll"), "__vbaSetSystemError"), ByVal &HC3&, 1, ByVal 0&)

    Form1.Show
End Sub

